import { useEffect, useState } from 'react';
import Son from './comps/Son';
import { createContext } from 'react';
export const Context = createContext<any>({});
const Index = () => {
  const [detail, setDetail] = useState({});

  useEffect(() => {
    setTimeout(() => {
      setDetail({
        name: '张三',
        age: 18,
      });
    }, 1000);
  }, []);

  return (
    <div>
      <Context.Provider value={detail}>
        <Son />
      </Context.Provider>
    </div>
  );
};

export default Index;
